home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / listx / redraw.frm < prev    next >
Text File  |  1997-11-12  |  3KB  |  92 lines

  1. VERSION 5.00
  2. Object = "{9FE255D1-F32E-11D0-9E15-444553540000}#1.0#0"; "MLISTX.OCX"
  3. Begin VB.Form Form1 
  4.    Caption         =   "List/X+ Redraw Sample"
  5.    ClientHeight    =   3510
  6.    ClientLeft      =   2085
  7.    ClientTop       =   2025
  8.    ClientWidth     =   4245
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   3510
  11.    ScaleWidth      =   4245
  12.    Begin MabryCtl.MList MList1 
  13.       Height          =   3015
  14.       Left            =   240
  15.       TabIndex        =   0
  16.       Top             =   240
  17.       Width           =   1935
  18.       _ExtentX        =   3413
  19.       _ExtentY        =   5318
  20.       Object.TabStop         =   -1  'True
  21.       MousePointer    =   -1163005939
  22.       ColRowOrder     =   -1  'True
  23.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  24.          Name            =   "MS Sans Serif"
  25.          Size            =   8.25
  26.          Charset         =   0
  27.          Weight          =   400
  28.          Underline       =   0   'False
  29.          Italic          =   0   'False
  30.          Strikethrough   =   0   'False
  31.       EndProperty
  32.       BeginProperty Columns {23BAA6DE-05A6-11D1-9E15-0020AFD6A9D5} 
  33.          ColumnCount     =   1
  34.          BeginProperty Column0 {23BAA6E0-05A6-11D1-9E15-0020AFD6A9D5} 
  35.             Object.Width           =   0
  36.             MinWidth        =   0
  37.             MaxWidth        =   -1
  38.             UserResizeEnabled=   -1
  39.             Heading         =   ""
  40.             Object.Visible         =   -1
  41.             ColumnAlignment =   0
  42.             HeadingAlignment=   0
  43.          EndProperty
  44.       EndProperty
  45.    End
  46.    Begin VB.Label Label2 
  47.       Caption         =   "Look in the Form_Load procedure to see how it's done."
  48.       Height          =   1215
  49.       Left            =   2280
  50.       TabIndex        =   2
  51.       Top             =   1440
  52.       Width           =   1695
  53.    End
  54.    Begin VB.Label Label1 
  55.       Caption         =   "This sample shows how to use the Windows API to disable list painting while adding items. "
  56.       Height          =   1095
  57.       Left            =   2280
  58.       TabIndex        =   1
  59.       Top             =   240
  60.       Width           =   1695
  61.    End
  62. End
  63. Attribute VB_Name = "Form1"
  64. Attribute VB_GlobalNameSpace = False
  65. Attribute VB_Creatable = False
  66. Attribute VB_PredeclaredId = True
  67. Attribute VB_Exposed = False
  68. Option Explicit
  69. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  70. Const WM_SETREDRAW = &HB
  71.  
  72. Private Sub Form_Load()
  73.    Dim i As Integer
  74.    
  75.    Me.Left = (Screen.Width - Me.ScaleWidth) / 2
  76.    Me.Top = (Screen.Height - Me.ScaleHeight) * 2 / 5
  77.    
  78.    Me.Show
  79.    DoEvents
  80.    '
  81.    ' turn off redraw
  82.    '
  83.    Call SendMessage(MList1.hwnd, WM_SETREDRAW, 0, 0)
  84.    For i = 1 To 1000
  85.       MList1.AddItem "foo" & i
  86.    Next
  87.    '
  88.    ' turn redraw back on, the control redraws automatically
  89.    '
  90.    Call SendMessage(MList1.hwnd, WM_SETREDRAW, -1, 0)
  91. End Sub
  92.